package vehicle;

/*
 * 子类：卡车类
 */

public class Truck extends Vehicle {
	private double tonnage; // 载重量

	public Truck() {

	}

	public Truck(String vehicleId, String type, double tonnage) {
		super(vehicleId, type);
		this.tonnage = tonnage;
	}

	public double getTonnage() {
		return tonnage;
	}

	public void setTonnage(double tonnage) {
		this.tonnage = tonnage;
	}

	// 重写父类的run（）方法
	public void run() {
		System.out.print("型号为" + this.getType() + "、车牌号为" + this.getVehicleId());
		System.out.println("、载重量为" + this.getTonnage() + "吨的卡车在行驶！");
	}

}
